﻿using System;
using System.Linq;

namespace TempEmployees.DAL
{
    partial class User
    {
        #region IFormattable Members & ToString()

        public override string ToString()
        {
            return this.ToString("G");
        }

        public string ToString(string format)
        {
            switch (format.ToUpperInvariant())
            {
                case "G":
                case "FN":
                    return string.Format("{0} {1}", FirstName, LastName);
                default:
                    throw new FormatException(String.Format("The {0} format string is not supported.", format));
            }
        }

        #endregion
    }
}